package com.sun.mybatisplus.controller;

import com.sun.mybatisplus.entity.User;
import com.sun.mybatisplus.resolver.annotation.CurrentUser;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/user")
public class UserController {


    @RequestMapping("/index")
    public String index() {
        return "index";
    }


    @RequestMapping("/save")
    public void save(User user){
        System.out.println(user);
    }


    @RequestMapping("/get")
    @ResponseBody
    public User getUser(@CurrentUser User user){
        return user;
    }
}
